//
//  DownloadViewModel.h
//  VideoPlayer
//
//  Created by 白璐 on 16/9/19.
//  Copyright © 2016年 baidu. All rights reserved.
//

#import "Defines.h"

@interface DownloadViewModel : NSObject<VideoSource>

@property(nonatomic, copy) void (^updateBlock)(NSUInteger index);

+ (DownloadViewModel*)defaultModel;
- (instancetype)init NS_UNAVAILABLE;

- (NSUInteger)count;
- (NSString*)image:(NSUInteger)index;
- (NSString*)title:(NSUInteger)index;
- (NSString*)detail:(NSUInteger)index;
- (NSString*)url:(NSUInteger)index;
- (NSString*)token:(NSUInteger)index;
- (DownloadState)state:(NSUInteger)index;
- (float)progress:(NSUInteger)index;

- (BOOL)isDownloading:(NSString*)url;

- (void)add:(VideoItem*)item cancelBlock:(void(^)(BOOL cancel))block;
- (void)action:(NSUInteger)index cancelBlock:(void(^)(BOOL cancel))block;
- (void)stop:(NSUInteger)index;
- (void)remove:(NSUInteger)index;

- (NSString*)cellIdentifier:(NSUInteger)index;

- (void)networkChanged:(NetworkType)network;

@end
